package com.scm.util;

import lombok.Data;

/**
 * @ClassName QueryResult
 * @Description TODO
 * @Author Xu
 * @Date 2021/7/7 11:25
 * @Version 1.0
 **/
@Data
public class QueryResult {
    private int code;
    private String msg;
    private Object data;
    private int total;
    int overCount;
    double allPrice;
    double overPrice;
    public static  QueryResult ok(int total,Object data){
        QueryResult r = new QueryResult();
        r.setCode(200);
        r.setMsg("成功");
        r.setData(data);
        r.setTotal(total);
        return r;
    }
    public  static  QueryResult ok2(int total,Object data,int overCount,double allPrice,double overPrice){
        QueryResult r = QueryResult.ok(total,data);
        r.setAllPrice(allPrice);
        r.setOverCount(overCount);
        r.setOverPrice(overPrice);
        return r;
    }
}
